package com.wps.wdztv6.api.request;

import com.alibaba.fastjson.annotation.JSONField;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.*;

/**
 * 图片操作
 */
@Data
@Builder
public class ImageOperateRequest {
    @JSONField(name = "task_id")
    private String taskId;

    @JSONField(name = "image_url")
    private String imageUrl;

    @JSONField(name = "image_filename")
    private String imageFilename;

    @JSONField(name = "scale")
    private Float scale;

    private Integer width;

    private Integer height;

    private Integer rotate;

    private Float quality;

    @JSONField(name = "horizontal_flip")
    private Boolean horizontalFlip;

    @JSONField(name = "vertical_flip")
    private Boolean verticalFlip;


    @JSONField(name = "text_watermark")
    private TextWatermark textWatermark;
    @JSONField(name = "image_watermark")
    private ImageWatermark imageWatermark;

    @Getter
    @Setter
    @ToString
    @Builder
    public static class TextWatermark{
        private String content;
        // 字体名称
        @JSONField(name = "font_name")
        private String fontName;
        //  是否加粗
        @JSONField(name = "bold")
        private Boolean bold;

        // 是否斜体
        @JSONField(name = "italic")
        private Boolean italic;

        // 字体大小
        @JSONField(name = "size")
        private Integer size;

        // 字体颜色
        @JSONField(name = "color")
        private String  color;

        // 透明度
        @JSONField(name = "transparent")
        private Float transparent;

        @JSONField(name = "rotate")
        private Float rotate;

        // 文字位置
        @JSONField(name = "position")
        private String position;

        // 水印是否平铺，平铺时水印位置无效，默认false
        @JSONField(name = "tiled")
        private Boolean tiled;
    }

    @Getter
    @Setter
    @Builder
    public static class ImageWatermark{
        @JSONField(name = "watermark_url")
        private String watermarkUrl;

        @JSONField(name = "watermark_filename")
        private String watermarkFilename;

        @JSONField(name = "transparent")
        private Float transparent;

        @JSONField(name = "rotate")
        private Float rotate;

        @JSONField(name = "position")
        private String position;

        @JSONField(name = "tiled")
        private Boolean tiled;

        // 水印图片缩放比例，0.1-5，默认：1。tiled为 true时，该参数无效。
        @JSONField(name = "scale")
        private Boolean scale;
    }
}
